home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / multitasking / feature / executive_v2.10 / executiveapi / executiveapi.h < prev    next >
C/C++ Source or Header  |  2000-03-02  |  3KB  |  108 lines

  1. /*
  2. **      $VER: ExecutiveAPI.h 1.00 (03.09.96)
  3. **      ExecutiveAPI Release 1.00
  4. **
  5. **      ExecutiveAPI definitions
  6. **
  7. **      Copyright © 1996-97 Petri Nordlund. All rights reserved.
  8. **
  9. **      $Id: ExecutiveAPI.h 1.1 1996/10/01 23:08:16 petrin Exp petrin $
  10. **
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif /* EXEC_TYPES_H */
  16.  
  17. #ifndef EXEC_PORTS_H
  18. #include "exec/ports.h"
  19. #endif /* EXEC_PORTS_H */
  20.  
  21.  
  22. /*
  23.  * Public message port to send messages to
  24.  *
  25.  */
  26. #define EXECUTIVEAPI_PORTNAME     "Executive_server"
  27.  
  28.  
  29. /*
  30.  * ExecutiveMessage
  31.  *
  32.  */
  33. struct ExecutiveMessage {
  34.     struct Message    message;
  35.     WORD        ident;        /* This must always be 0        */
  36.  
  37.     WORD        command;    /* Command to be sent, see below    */
  38.     struct Task    *task;        /* Task address                */
  39.     STRPTR        taskname;    /* Task name                */
  40.     LONG        value1;        /* Depends on command            */
  41.     LONG        value2;        /* Depends on command            */
  42.     LONG        value3;        /* Depends on command            */
  43.     LONG        value4;        /* Depends on command            */
  44.     WORD        error;        /* Non-zero if error, see below        */
  45.  
  46.     LONG        reserved[4];    /* Reserved for future use        */
  47. };
  48.  
  49.  
  50. /*
  51.  * Commands
  52.  *
  53.  */
  54. enum {
  55.     EXAPI_CMD_ADD_CLIENT = 0,    /* Add new client                */
  56.     EXAPI_CMD_REM_CLIENT,        /* Remove client                */
  57.  
  58.     EXAPI_CMD_GET_NICE,        /* Get nice-value                */
  59.     EXAPI_CMD_SET_NICE,        /* Set nice-value                */
  60.  
  61.     EXAPI_CMD_GET_PRIORITY,        /* Get task's correct (not scheduling) priority    */
  62.  
  63.     EXAPI_CMD_WATCH,        /* Schedle, don't schedle etc. See below    */
  64. };
  65.  
  66.  
  67. /*
  68.  * These are used with EXAPI_CMD_WATCH
  69.  *
  70.  */
  71.  
  72. /* --> value1 */
  73. enum {
  74.     EXAPI_WHICH_TASK = 0,        /* Current task                    */
  75.     EXAPI_WHICH_CHILDTASKS,        /* Childtasks of this task            */
  76. };
  77.  
  78. /* --> value2 */
  79. enum {
  80.     EXAPI_TYPE_SCHEDULE = 0,    /* Schedule    this task / childtasks        */
  81.     EXAPI_TYPE_NOSCHEDULE,        /* Don't schedule this task / childtasks    */
  82.     EXAPI_TYPE_RELATIVE,        /* Childtasks' priority relative to parent's    */
  83.                     /* priority.                    */
  84. };
  85.  
  86. /* --> value3 */
  87. /* These are only used with EXAPI_TYPE_NOSCHEDULE */
  88. enum {
  89.     EXAPI_PRI_LEAVE_ALONE = 0,    /* Ignore task priority                */
  90.     EXAPI_PRI_ABOVE,        /* Task's priority kept above scheduled tasks    */
  91.     EXAPI_PRI_BELOW,        /* Task's priority kept below scheduled tasks    */
  92.     EXAPI_PRI_SET            /* Set priority to given value (value4)        */
  93. };
  94.  
  95.  
  96. /*
  97.  * Errors
  98.  *
  99.  */
  100. enum {
  101.     EXAPI_OK = 0,            /* No error                    */
  102.     EXAPI_ERROR_TASK_NOT_FOUND,    /* Specified task wasn't found            */
  103.     EXAPI_ERROR_NO_SERVER,        /* Server not available (quitting)        */
  104.     EXAPI_ERROR_INTERNAL,        /* Misc. error (e.g. no memory)            */
  105.     EXAPI_ERROR_ALREADY_WATCHED,    /* Task is already being watched, meaning that    */
  106.                     /* user has put the task to "Executive.prefs".    */
  107. };
  108.